import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'main',
      redirect: { name: 'music' },
      component: require('@/pages/main').default,
      children: [
        {
          path: 'music',
          name: 'music',
          component: require('@/pages/music/index.vue').default
        },
        {
          path: 'playlist-detail',
          name: 'playlist-detail',
          component: () => import('@/pages/playlist/detail.vue')
        },
        {
          path: 'lyric',
          name: 'lyric',
          component: () => import('@/pages/music/lyric/index')
        },
        {
          path: '/landing-page',
          name: 'landing-page',
          component: require('@/pages/LandingPage').default
        },
        {
          path: '/home',
          name: 'home',
          component: require('@/pages/Home.vue').default
        }
      ]
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
